package com.example.business_oa.controller;

import com.example.business_oa.service.BusiService;
import com.example.comment_oa.pojos.attendance.BusinessTripAp;
import com.example.comment_oa.response.AjaxResponse;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@RequestMapping("/businessOa/Busi")
public class BusiController {
    @Resource
    BusiService busiService;

    //新增
    @PostMapping("/ap")
    public AjaxResponse addBusi(BusinessTripAp businessTripAp, MultipartFile file){
        //启动出差流程

        //新增出差
        busiService.apBusi(businessTripAp,file);
        return AjaxResponse.success();
    }

    @PostMapping("/no")
    public AjaxResponse noBusi(){

        //拒绝
//        busiService.no
        return AjaxResponse.success();
    }

    @PostMapping("/yes")
    public AjaxResponse yesBusi(){
        return AjaxResponse.success();
    }

}
